"use strict";
cc._RF.push(module, '8b9afSiD4ZGtr7L4GOIcmzi', 'SoundMgr');
// scripts/SoundMgr.js

"use strict";

var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
  value: !0
});

var o = e("DataMgr"),
    i = cc._decorator,
    a = i.ccclass,
    r = i.property,
    s = function (e) {
  __extends(t, e);

  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.soundAudioSource = null;
    t.musicAudioSource = null;
    return t;
  }

  n = t;

  t.prototype.onLoad = function () {
    n.Instance = this;
    this.soundAudioSource.volume = o["default"].Instance.audioVolume;
    this.musicAudioSource.volume = o["default"].Instance.audioVolume;
  };

  t.prototype.onEnable = function () {
    SDK.Base.Event.on("PauseMusic", this.PauseMusic, this);
    SDK.Base.Event.on("ResumeMusic", this.ResumeMusic, this);
  };

  t.prototype.onDisable = function () {
    SDK.Base.Event.off("PauseMusic", this.PauseMusic, this);
    SDK.Base.Event.off("ResumeMusic", this.ResumeMusic, this);
  };

  t.prototype.PauseMusic = function () {
    this.soundAudioSource.volume = 0;
    this.musicAudioSource.volume = 0;
  };

  t.prototype.ResumeMusic = function () {
    this.soundAudioSource.volume = o["default"].Instance.audioVolume;
    this.musicAudioSource.volume = o["default"].Instance.audioVolume;
  };

  t.prototype.playSoundClip = function (e) {
    if (cc.sys.platform == cc.sys.VIVO_GAME) {
      this.soundAudioSource.clip = e;
      this.soundAudioSource.play();
    } else cc.audioEngine.playEffect(e, !1);
  };

  var n;
  t.Instance = void 0;

  __decorate([r(cc.AudioSource)], t.prototype, "soundAudioSource", void 0);

  __decorate([r(cc.AudioSource)], t.prototype, "musicAudioSource", void 0);

  return n = __decorate([a], t);
}(cc.Component);

n["default"] = s;

cc._RF.pop();